package hczc.longcai.com.hccrowdfunding.utils.httputils;

/**
 * 接口的地址
 * Created by Administrator on 2016/2/24.
 */
public class HttpPath {

    /**
     * 接口请求地址
     */
    public static final String URL = "http://hjijin.cn:800/api/";

    /**
     * 登陆的接口地址
     *
     * @param userName 用户名
     * @param password 密码
     * @return 完整的登录接口
     */
    public static String getURL_LOGIN(String userName, String password) {
        return URL +
                "login?" +
                "txtUsername=" + userName + "&" +
                "txtPwd=" + password;
    }

    /**
     * 注册的接口地址
     *
     * @param userName 用户名
     * @param password 密码
     * @param textCode 验证码
     * @param codeId   验证码ID
     * @return 完整的注册接口
     */
    public static String getURL_Register(String userName, String password, String textCode, String codeId) {
        return URL +
                "reg?" +
                "txtUsername=" + userName + "&" +
                "txtPwd=" + password + "&" +
                "txtCode=" + textCode + "&" +
                "codeId=" + codeId;
    }

    /**
     * 发送验证码的接口地址
     *
     * @param txtPhone 手机号码
     * @param act      发送类型
     * @return 完整的发送验证码接口
     */
    public static String getURL_Code(String txtPhone, String act) {
        if (act != null) {
            return URL +
                    "sendcode?" +
                    "txtPhone=" + txtPhone + "&" +
                    "act=" + act;
        }
        return URL +
                "sendcode?" +
                "txtPhone=" + txtPhone;
    }

    /**
     * 找回密码的接口地址
     *
     * @param txtPhone    用户手机号
     * @param txtCode     验证码
     * @param codeId      验证码ID
     * @param txtPassword 新密码
     * @return 完整的找回密码接口
     */
    public static String getURL_Findpass(String txtPhone, String txtCode, String codeId, String txtPassword) {

        return URL +
                "findpass?" +
                "txtPhone=" + txtPhone + "&" +
                "txtCode=" + txtCode + "&" +
                "codeId=" + codeId + "&" +
                "txtPassword=" + txtPassword;
    }

    /**
     * 修改密码的接口地址
     *
     * @param uid         用户uid
     * @param oldPasswd   旧密码
     * @param newPasswd   新密码
     * @param newPasswdRe 重复新密码
     * @return 完整的修改密码接口地址
     */
    public static String getURL_Editpass(String uid, String oldPasswd, String newPasswd, String newPasswdRe) {
        return URL +
                "editpass?" +
                "uid=" + uid + "&" +
                "oldPasswd=" + oldPasswd + "&" +
                "newPasswd=" + newPasswd + "&" +
                "newPasswdRe=" + newPasswdRe;
    }

    /**
     * 获取用户信息的接口地址
     *
     * @param uid 用户的uid
     * @return 完整的获取用户信息的接口地址
     */
    public static String getURL_Userinfo(String uid) {
        return URL +
                "getminfo?" +
                "uid=" + uid;
    }


}
